﻿Imports Microsoft.VisualBasic
Imports System.Data.OleDb

Public Class Order
    Public Shared Function CancelOrderLine(ByVal orderlineid As Integer) As Boolean
        Dim retval As Boolean = True
        Dim accessCon As New OleDbConnection(ConfigurationManager.ConnectionStrings("GotPinkDB").ConnectionString)

        accessCon.Open()
        Dim sql As String = "Update OrderLine Set isCanceled=1 Where OrderLineID=@OrderLineID"
        Dim accessCom As New OleDbCommand(sql, accessCon)
        Dim param1 As OleDbParameter = accessCom.Parameters.Add("@OrderLineID", OleDbType.Integer)
        param1.Value = orderlineid

        Try
            accessCom.ExecuteScalar()
        Catch ex As Exception
            retval = False
        Finally
            accessCom.Dispose()
            accessCon.Close()
        End Try
        Return retval
    End Function
End Class
